namespace OasisCiq.Xnl
{
    using System;
    using System.Linq;

    /// <summary>
    /// A list of common types for organisation names
    /// </summary>
    public class OrganisationNameTypeList : XS.XSNormalizedString
    {
        private static readonly string[] PossibleValues = new[]
        {
            "LegalName",
            "FormerName", // Former name of the organisation
            "CommonUse",
            "PublishingName",
            "OfficialName",
            "UnofficialName",
            "Undefined" // unknown
        };

        public OrganisationNameTypeList(string value)
            : base(value)
        {
            if (!PossibleValues.Contains(value))
            {
                throw new ArgumentOutOfRangeException();
            }
        }
    }
}